#ifndef EQ_PLY_WINDOW_H
#define EQ_PLY_WINDOW_H

#include <eq/eq.h>

namespace eqPc
{
    class RenderState;

    /**
     * A window represent an OpenGL drawable and context
     *
     * Manages OpenGL-specific data, i.e., it creates the logo texture during
     * initialization and holds a state object for GL object creation. It
     * initializes the OpenGL state and draws the statistics overlay.
     */
    class Window : public eq::Window
    {
    public:
        Window( eq::Pipe* parent ) 
                : eq::Window( parent ), _state( 0 ), _logoTexture( 0 ) {}

        const eq::util::Texture* getLogoTexture() const { return _logoTexture; }
        RenderState& getState() { return *_state; }
        
    protected:
        virtual ~Window() {}
        virtual bool configInitSystemWindow( const eq::uint128_t& initID );
        virtual bool configInitGL( const eq::uint128_t& initID );
        virtual bool configExitGL();
        virtual void frameStart( const eq::uint128_t& frameID,
                                 const uint32_t frameNumber );

    private:
        RenderState* _state;
        eq::util::Texture* _logoTexture;

        void _loadLogo();
        void _loadShaders();
    };
}

#endif // EQ_PLY_WINDOW_H